package cn.tedu.submarine;

import javax.swing.*;

/**
 * 图片类
 * @author XingHaiYang
 * @date 2022/8/27 15:13
 */
public class Images {
    //  公开的  静态的  图片数据类型   变量名
    public static ImageIcon battleship; //战舰图
    public static ImageIcon obsersubmarine;  //侦察潜艇图
    public static ImageIcon torpesubmarine;  //鱼雷潜艇图
    public static ImageIcon minesubmarine;   //水雷潜艇图
    public static ImageIcon mine;       //水雷图
    public static ImageIcon bomb;       //深水炸弹图
    public static ImageIcon sea;        //海洋图
    public static ImageIcon gameover;   //游戏结束图

    static{ //初始化静态资源
        battleship = new ImageIcon("img/battleship.png");
        obsersubmarine = new ImageIcon("img/obsersubm.png");
        torpesubmarine = new ImageIcon("img/torpesubm.png");
        minesubmarine = new ImageIcon("img/minesubm.png");
        mine = new ImageIcon("img/mine.png");
        bomb = new ImageIcon("img/bomb.png");
        sea = new ImageIcon("img/sea.png");
        gameover = new ImageIcon("img/gameover.png");
    }

    public static void main(String[] args) {
        //返回8表示读取成功，否则表示读取失败
        System.out.println(battleship.getImageLoadStatus());
        System.out.println(obsersubmarine.getImageLoadStatus());
        System.out.println(torpesubmarine.getImageLoadStatus());
        System.out.println(minesubmarine.getImageLoadStatus());
        System.out.println(mine.getImageLoadStatus());
        System.out.println(bomb.getImageLoadStatus());
        System.out.println(sea.getImageLoadStatus());
        System.out.println(gameover.getImageLoadStatus());
    }
}
